<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>

        var a = prompt('请输入姓名');

        alert('your name is ' + a);

        //只申明不赋值
        var b;
        console.log(b); // 输出undefined

        //不申明不赋值会报错
        //不申明直接赋值可以使用
        qq = 110;
        console.log(qq);
    </script>
</head>

<body>

</body>

</html>